import { RouteRecordRaw } from 'vue-router';

/**
 * 建议：路由 path 路径与文件夹名称相同，找文件可浏览器地址找，方便定位文件位置
 *
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      isLink：        是否超链接菜单，开启外链条件，`1、isLink: 链接地址不为空 2、isIframe:false`
 *      isHide：        是否隐藏此路由
 *      isKeepAlive：   是否缓存组件状态
 *      isAffix：       是否固定在 tagsView 栏上
 *      isIframe：      是否内嵌窗口，开启条件，`1、isIframe:true 2、isLink：链接地址不为空`
 *      roles：         当前路由权限标识，取角色管理。控制路由显示、隐藏。超级管理员：admin 普通角色：common
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

// 扩展 RouteMeta 接口
declare module 'vue-router' {
	interface RouteMeta {
		title?: string;
		isLink?: string;
		isHide?: boolean;
		isKeepAlive?: boolean;
		isAffix?: boolean;
		isIframe?: boolean;
		roles?: string[];
		icon?: string;
	}
}

/**
 * 定义动态路由
 * 前端添加路由，请在顶级节点的 `children 数组` 里添加
 * @description 未开启 isRequestRoutes 为 true 时使用（前端控制路由），开启时第一个顶级 children 的路由将被替换成接口请求回来的路由数据
 * @description 各字段请查看 `/@/views/system/menu/component/addMenu.vue 下的 ruleForm`
 * @returns 返回路由菜单数据
 */
export const dynamicRoutes: Array<RouteRecordRaw> = [
	{
		path: '/',
		name: '/',
		component: () => import('/@/layout/index.vue'),
		redirect: '/home',
		meta: {
			isKeepAlive: true,
		},
		children: [
			{
				path: '/home',
				name: 'home',
				component: () => import('/@/views/home/index.vue'),
				meta: {
					title: '首页',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: true,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-HomeFilled',

				},
			},
			{
				path: '/lockScreen',
				name: 'lockScreen',
				component: () => import('/@/views/lockScreen/index.vue'),
				meta: {
					isLink: '',
					isHide: true,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					 hideBreadcrumb: true, // 新增字段
					roles: ['admin', 'common'],
					icon: 'ele-StarFilled',

				},
			},
			{
				path: '/shpoingIndex',
				name: 'shpoingIndex',
				component: () => import('/@/views/shpoing/index.vue'),
				meta: {
					title: '创业/就业',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-StarFilled',

				},
			},
			{
				path: '/announcement',
				name: 'announcement',
				component: () => import('/@/views/announcement/index.vue'),
				meta: {
					title: '志愿者招募',
					isLink: '',
					isHide: false,
					isKeepAlive: true,

					roles: ['admin', 'common'],
					icon: 'ele-Avatar',

				},
			},
			{
				path: '/service',
				name: 'service',
				component: () => import('/@/views/service/index.vue'),
				meta: {
					title: '报名记录',
					isLink: '',
					isHide: false,
					isKeepAlive: true,

					roles: ['admin', 'common'],
					icon: 'ele-Memo',
				},
			},
			{
				path: '/system',
				name: 'system',
				component: () => import('/@/layout/routerView/parent.vue'),
				redirect: '/system',
				meta: {
					title: '公共配置',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-SetUp',

				},
				children: [
					{
						path: '/system/order',
						name: 'systemOrder',
						component: () => import('/@/views/system/order/index.vue'),
						meta: {
							title: '菜单管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],

							icon: 'ele-Operation',
						},
					},
					{
						path: '/system/withdraw',
						name: 'systemWithdraw',
						component: () => import('/@/views/system/withdraw/index.vue'),
						meta: {
							title: '角色管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Avatar',

						},
					},
					{
						path: '/system/earnings',
						name: 'systemEarnings',
						component: () => import('/@/views/system/earnings/index.vue'),
						meta: {
							title: '轮播管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-SwitchFilled',

						},
					},
					{
						path: '/system/annount',
						name: 'systemAnnount',
						component: () => import('/@/views/system/annount/index.vue'),
						meta: {
							title: '公告管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Eleme',
						},
					},
				],
			},
			{
				path: '/pointsMall',
				name: 'pointsMall',
				component: () => import('/@/layout/routerView/parent.vue'),
				redirect: '/pointsMall',
				meta: {
					title: '积分商城',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-Ticket',

				},
				children: [
					{
						path: '/pointsMall/classify',
						name: 'pointsMallClassify',
						component: () => import('/@/views/pointsMall/classify/index.vue'),
						meta: {
							title: '商品分类',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							// roles: ['admin'],
							icon: 'ele-Operation',

						},
					},
					{
						path: '/pointsMall/goods',
						name: 'pointsMallGoods',
						component: () => import('/@/views/pointsMall/goods/goods.vue'),
						meta: {
							title: '积分商品',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							// roles: ['admin'],	
							icon: 'ele-GoodsFilled',
						},
					},
					{
						path: '/pointsMall/banner',
						name: 'accountsBanner',
						component: () => import('/@/views/pointsMall/banner/index.vue'),
						meta: {
							title: '轮播管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							// roles: ['admin'],	
							icon: 'ele-SwitchFilled',
						},
					},
					{
						path: '/pointsMall/conversion',
						name: 'conversion',
						component: () => import('/@/views/pointsMall/conversion/index.vue'),
						meta: {
							title: '兑换记录',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							// roles: ['admin'],	
							icon: 'ele-Present',
						},
					},
				],
			},
			{
				path: '/delicious',
				name: 'delicious',
				component: () => import('/@/layout/routerView/parent.vue'),
				redirect: '/delicious',
				meta: {
					title: '美食管理',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-DishDot',
				},
				children: [
					{
						path: '/delicious/classify',
						name: 'classify',
						component: () => import('/@/views/delicious/classify/index.vue'),
						meta: {
							title: '美食店铺分类',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							// roles: ['admin'],
							roles: ['admin', 'common'],

							icon: 'ele-Shop',
						},
					},
					{
						path: '/delicious/manage',
						name: 'manage',
						component: () => import('/@/views/delicious/manage/manage.vue'),
						meta: {
							title: '店铺管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Operation',
						},
					},
					{
						path: '/delicious/goods',
						name: 'goods',
						component: () => import('/@/views/delicious/goods/goods.vue'),
						meta: {
							title: '美食商品',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Fries',

						},
					},
					{
						path: '/delicious/order',
						name: 'order',
						component: () => import('/@/views/delicious/order/order.vue'),
						meta: {
							title: '美食订单',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Mug',
						},
					},
					{
						path: '/delicious/list',
						name: 'deliciousList',
						component: () => import('/@/views/delicious/list/list.vue'),
						meta: {
							title: '美食商品分类',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-KnifeFork',

						},
					},
					// {
					// 	path: '/banners/fineZlist',
					// 	name: 'bannersfineZlist',
					// 	component: () => import('/@/views/banners/fineZlist/index.vue'),
					// 	meta: {
					// 		title: '美食会员列表',
					// 		isLink: '',
					// 		isHide: false,
					// 		isKeepAlive: true,
					// 		isAffix: false,
					// 		isIframe: false,
					// 		roles: ['admin', 'common'],
					// 		icon: 'ele-BrushFilled',
					// 	},
					// },
				],
			},
			{
				path: '/active',
				name: 'active',
				component: () => import('/@/layout/routerView/parent.vue'),
				redirect: '/active',
				meta: {
					title: '游玩管理',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-MoonNight',

				},
				children: [
					{
						path: '/active/actInacoun',
						name: 'accountActinacoun',
						component: () => import('/@/views/active/activeInacoun/Activeinacoun.vue'),
						meta: {
							title: '游玩分类',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],

							icon: 'ele-Operation',
						},
					},
					{
						path: '/active/activeApply',
						name: 'activeApply',
						component: () => import('/@/views/active/activeApply/Activeapply.vue'),
						meta: {
							title: '游玩景区',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Sunrise',
						},
					},
					{
						path: '/active/ticket',
						name: 'ticket',
						component: () => import('/@/views/active/ticket/ticket.vue'),
						meta: {
							title: '景区门票',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-List',
						},
					},
					{
						path: '/active/sceicOrder',
						name: 'activeSceicOrder',
						component: () => import('/@/views/active/sceicOrder/index.vue'),
						meta: {
							title: '景区订单',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Checked',

						},
					},
					// {
					// 	path: '/active/sceicZ',
					// 	name: 'activeSceicZ',
					// 	component: () => import('/@/views/active/sceicZ/index.vue'),
					// 	meta: {
					// 		title: '游玩会员管理',
					// 		isLink: '',
					// 		isHide: false,
					// 		isKeepAlive: true,
					// 		isAffix: false,
					// 		isIframe: false,
					// 		roles: ['admin', 'common'],
					// 		icon: 'ele-BrushFilled',

					// 	},
					// },

				],
			},


			{
				path: '/recreation',
				name: 'recreation',
				component: () => import('/@/layout/routerView/parent.vue'),
				redirect: '/recreation',
				meta: {
					title: '娱乐管理',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-Rank',
				},
				children: [
					{
						path: '/recreation/shop',
						name: 'accountshop',
						component: () => import('/@/views/recreation/shop/index.vue'),
						meta: {
							title: '娱乐门店类型分组',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-PictureFilled',
						},
					},
					{
						path: '/recreation/shopeet',
						name: 'recreationshopeet',
						component: () => import('/@/views/recreation/shopeet/index.vue'),
						meta: {
							title: '娱乐门店类型',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Shop',
						},
					},
					{
						path: '/recreation/shopllt',
						name: 'recreationshopllt',
						component: () => import('/@/views/recreation/shopllt/index.vue'),
						meta: {
							title: '娱乐门店',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-MessageBox',

						},
					},
					{
						path: '/recreation/shopmeal',
						name: 'recreationshopmeal',
						component: () => import('/@/views/recreation/shopmeal/index.vue'),
						meta: {
							title: '娱乐套餐管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-KnifeFork',

						},
					},
					{
						path: '/recreation/shoporder',
						name: 'recreationshoporder',
						component: () => import('/@/views/recreation/shoporder/index.vue'),
						meta: {
							title: '娱乐订单',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Checked',

						},
					},
					{
						path: '/recreation/shopZlist',
						name: 'recreationshopZlist',
						component: () => import('/@/views/recreation/shopZlist/index.vue'),
						meta: {
							title: '娱乐会员列表',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],
							icon: 'ele-Brush',
						},
					},

				],
			},
			// 酒店管理
			{
				path: '/hotel',
				name: 'hotel',
				component: () => import('/@/layout/routerView/parent.vue'),
				redirect: '/hotel',
				meta: {
					title: '酒店管理',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'ele-OfficeBuilding',

				},
				children: [
					{
						path: '/hotel/room',
						name: 'hotelY',
						component: () => import('/@/views/hotel/room/index.vue'),
						meta: {
							title: '酒店房间',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],

							icon: 'ele-Refrigerator',
						},
					},

					{
						path: '/hotel/house',
						name: 'hotelR',
						component: () => import('/@/views/hotel/house/index.vue'),
						meta: {
							title: '酒店房型',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],

							icon: 'ele-School',
						},
					},
					{
						path: '/hotel/list',
						name: 'list',
						component: () => import('/@/views/hotel/list/index.vue'),
						meta: {
							title: '酒店列表',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],

							icon: 'ele-Operation',
						},
					},
					{
						path: '/hotel/manage',
						name: 'hotelSi',
						component: () => import('/@/views/hotel/manage/index.vue'),
						meta: {
							title: '酒店会员管理',
							isLink: '',
							isHide: false,
							isKeepAlive: true,
							isAffix: false,
							isIframe: false,
							roles: ['admin', 'common'],

							icon: 'ele-Brush',
						},
					},
				],
			},

			// {
			// 	path: '/scenic',
			// 	name: 'scenic',
			// 	component: () => import('/@/views/scenic/index.vue'),
			// 	// component: () => import('/@/layout/routerView/parent.vue'),
			// 	meta: {
			// 		title: '留言记录',
			// 		isLink: '',
			// 		isHide: false,
			// 		isKeepAlive: true,

			// 		roles: ['admin', 'common'],
			// 		icon: 'ele-Camera',
			// 	},
			// },
			// {
			// 	path: '/servicestt',
			// 	name: 'servicestt',
			// 	component: () => import('/@/views/servicestt/index.vue'),
			// 	meta: {
			// 		title: '客服管理',
			// 		isLink: '',
			// 		isHide: false,
			// 		isKeepAlive: true,

			// 		roles: ['admin', 'common'],
			// 		icon: 'ele-Avatar',
			// 	},
			// },
			// {
			// 	path: '/OfficialIndex',
			// 	name: 'Official',
			// 	component: () => import('/@/views/Official/index.vue'),
			// 	meta: {
			// 		title: '项目配置',
			// 		isLink: '',
			// 		isHide: false,
			// 		isKeepAlive: true,
			// 		isAffix: false,
			// 		isIframe: false,
			// 		roles: ['admin', 'common'],

			// 		icon: 'ele-Tickets',
			// 	},
			// },
		],
	},
];
/**
 * 定义404、401界面
 * @link 参考：https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
 */
export const notFoundAndNoPower = [
	{
		path: '/:path(.*)*',
		name: 'notFound',
		component: () => import('/@/views/error/404.vue'),
		meta: {
			title: '找不到此页面',
			isHide: true,
		},
	},
	{
		path: '/401',
		name: 'noPower',
		component: () => import('/@/views/error/401.vue'),
		meta: {
			title: '没有权限',
			isHide: true,
		},
	},
];

/**
 * 定义静态路由（默认路由）
 * 此路由不要动，前端添加路由的话，请在 `dynamicRoutes 数组` 中添加
 * @description 前端控制直接改 dynamicRoutes 中的路由，后端控制不需要修改，请求接口路由数据时，会覆盖 dynamicRoutes 第一个顶级 children 的内容（全屏，不包含 layout 中的路由出口）
 * @returns 返回路由菜单数据
 */
export const staticRoutes = [
	{
		path: '/login',
		name: 'login',
		component: () => import('/@/views/login/index.vue'),
		meta: {
			title: '登录',
		},
	},
];
